using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Density
{
    /// <summary>
    /// <para>Point Density</para>
    /// <para>Calculates a magnitude-per-unit area from point features that fall within a neighborhood around each cell.</para>
    /// <para>根据位于每个像元周围邻域内的点要素计算单位面积的量级。</para>
    /// </summary>    
    [DisplayName("Point Density")]
    public class PointDensity : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public PointDensity()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_point_features">
        /// <para>Input point features</para>
        /// <para>The input point features for which to calculate the density.</para>
        /// <para>要计算密度的输入点要素。</para>
        /// </param>
        /// <param name="_population_field">
        /// <para>Population field</para>
        /// <para><xdoc>
        ///   <para>Field denoting population values for each point. The population field is the count or quantity to be used in the calculation of a continuous surface.</para>
        ///   <para>Values in the population field can be integer or floating point.</para>
        ///   <para>The options and default behaviors for the field are listed below.</para>
        ///   <bulletList>
        ///     <bullet_item>
        ///       <para>Use None if no item or special value will be used and each feature will be counted once.</para>
        ///     </bullet_item><para/>
        ///     <bullet_item>
        ///       <para>You can use the Shape field if input features contain Z.</para>
        ///     </bullet_item><para/>
        ///     <bullet_item>
        ///       <para>Otherwise, the default field is POPULATION. The following conditions may also apply:</para>
        ///       <bulletList>
        ///         <bullet_item>If there is no POPULATION field, but there is a POPULATIONxxxx field, it will be used by default. The xxxx can be any valid characters, for example, POPULATION6, POPULATION1974, and POPULATIONROADTYPE.</bullet_item><para/>
        ///         <bullet_item>If there is no POPULATION field or POPULATIONxxxx field, but there is a POP field, it will be used by default.</bullet_item><para/>
        ///         <bullet_item>If there is no POPULATION field, POPULATIONxxxx field, or POP field, but there is a POPxxxx field, it will be used by default.</bullet_item><para/>
        ///         <bullet_item>If there is no POPULATION field, POPULATIONxxxx field, POP field, or POPxxxx field, NONE will be used by default.</bullet_item><para/>
        ///       </bulletList>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>表示每个点的人口值的字段。种群字段是用于计算连续曲面的计数或数量。</para>
        ///   <para>population 字段中的值可以是整数或浮点数。</para>
        ///   <para>下面列出了该字段的选项和默认行为。</para>
        ///   <bulletList>
        ///     <bullet_item>
        ///       <para>如果不使用任何项目或特殊值，并且每个要素将计数一次，则使用“无”。</para>
        ///     </bullet_item><para/>
        ///     <bullet_item>
        ///       <para>如果输入要素包含 Z，则可以使用形状字段。</para>
        ///     </bullet_item><para/>
        ///     <bullet_item>
        ///       <para>否则，默认字段为 POPULATION。以下条件可能也适用：</para>
        ///       <bulletList>
        ///         <bullet_item>如果没有 POPULATION 字段，但有 POPULATIONxxxx 字段，则默认使用该字段。xxxx 可以是任何有效字符，例如 POPULATION6、POPULATION1974 和 POPULATIONROADTYPE。</bullet_item><para/>
        ///         <bullet_item>如果没有 POPULATION 字段或 POPULATIONxxxx 字段，但有 POP 字段，则默认使用。</bullet_item><para/>
        ///         <bullet_item>如果没有 POPULATION 字段、POPULATIONxxxx 字段或 POP 字段，但有 POPxxxx 字段，则默认使用该字段。</bullet_item><para/>
        ///         <bullet_item>如果没有 POPULATION 字段、POPULATIONxxxx 字段、POP 字段或 POPxxxx 字段，则默认使用 NONE。</bullet_item><para/>
        ///       </bulletList>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output point density raster.</para>
        ///   <para>It is always a floating point raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出点密度栅格。</para>
        ///   <para>它始终是浮点栅格。</para>
        /// </xdoc></para>
        /// </param>
        public PointDensity(object _in_point_features, object _population_field, object _out_raster)
        {
            this._in_point_features = _in_point_features;
            this._population_field = _population_field;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Point Density";

        public override string CallName => "sa.PointDensity";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_point_features, _population_field, _out_raster, _cell_size, _neighborhood, _area_unit_scale_factor.GetGPValue()];

        /// <summary>
        /// <para>Input point features</para>
        /// <para>The input point features for which to calculate the density.</para>
        /// <para>要计算密度的输入点要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input point features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_point_features { get; set; }


        /// <summary>
        /// <para>Population field</para>
        /// <para><xdoc>
        ///   <para>Field denoting population values for each point. The population field is the count or quantity to be used in the calculation of a continuous surface.</para>
        ///   <para>Values in the population field can be integer or floating point.</para>
        ///   <para>The options and default behaviors for the field are listed below.</para>
        ///   <bulletList>
        ///     <bullet_item>
        ///       <para>Use None if no item or special value will be used and each feature will be counted once.</para>
        ///     </bullet_item><para/>
        ///     <bullet_item>
        ///       <para>You can use the Shape field if input features contain Z.</para>
        ///     </bullet_item><para/>
        ///     <bullet_item>
        ///       <para>Otherwise, the default field is POPULATION. The following conditions may also apply:</para>
        ///       <bulletList>
        ///         <bullet_item>If there is no POPULATION field, but there is a POPULATIONxxxx field, it will be used by default. The xxxx can be any valid characters, for example, POPULATION6, POPULATION1974, and POPULATIONROADTYPE.</bullet_item><para/>
        ///         <bullet_item>If there is no POPULATION field or POPULATIONxxxx field, but there is a POP field, it will be used by default.</bullet_item><para/>
        ///         <bullet_item>If there is no POPULATION field, POPULATIONxxxx field, or POP field, but there is a POPxxxx field, it will be used by default.</bullet_item><para/>
        ///         <bullet_item>If there is no POPULATION field, POPULATIONxxxx field, POP field, or POPxxxx field, NONE will be used by default.</bullet_item><para/>
        ///       </bulletList>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>表示每个点的人口值的字段。种群字段是用于计算连续曲面的计数或数量。</para>
        ///   <para>population 字段中的值可以是整数或浮点数。</para>
        ///   <para>下面列出了该字段的选项和默认行为。</para>
        ///   <bulletList>
        ///     <bullet_item>
        ///       <para>如果不使用任何项目或特殊值，并且每个要素将计数一次，则使用“无”。</para>
        ///     </bullet_item><para/>
        ///     <bullet_item>
        ///       <para>如果输入要素包含 Z，则可以使用形状字段。</para>
        ///     </bullet_item><para/>
        ///     <bullet_item>
        ///       <para>否则，默认字段为 POPULATION。以下条件可能也适用：</para>
        ///       <bulletList>
        ///         <bullet_item>如果没有 POPULATION 字段，但有 POPULATIONxxxx 字段，则默认使用该字段。xxxx 可以是任何有效字符，例如 POPULATION6、POPULATION1974 和 POPULATIONROADTYPE。</bullet_item><para/>
        ///         <bullet_item>如果没有 POPULATION 字段或 POPULATIONxxxx 字段，但有 POP 字段，则默认使用。</bullet_item><para/>
        ///         <bullet_item>如果没有 POPULATION 字段、POPULATIONxxxx 字段或 POP 字段，但有 POPxxxx 字段，则默认使用该字段。</bullet_item><para/>
        ///         <bullet_item>如果没有 POPULATION 字段、POPULATIONxxxx 字段、POP 字段或 POPxxxx 字段，则默认使用 NONE。</bullet_item><para/>
        ///       </bulletList>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Population field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _population_field { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output point density raster.</para>
        ///   <para>It is always a floating point raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出点密度栅格。</para>
        ///   <para>它始终是浮点栅格。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Output cell size</para>
        /// <para><xdoc>
        ///   <para>The cell size of the output raster that will be created.</para>
        ///   <para>This parameter can be defined by a numeric value or obtained from an existing raster dataset. If the cell size hasn't been explicitly specified as the parameter value, the environment cell size value will be used if specified; otherwise, additional rules will be used to calculate it from the other inputs. See the usage section for more detail.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将创建的输出栅格的像元大小。</para>
        ///   <para>此参数可以由数值定义，也可以从现有栅格数据集中获取。如果尚未将像元大小显式指定为参数值，则在指定的情况下将使用环境像元大小值;否则，将使用其他规则从其他输入计算它。有关详细信息，请参阅用法部分。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output cell size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        /// <summary>
        /// <para>Neighborhood</para>
        /// <para><xdoc>
        ///   <para>Dictates the shape of the area around each cell that is used to calculate the density value.</para>
        ///   <bulletList>
        ///     <bullet_item>Annulus—A torus (donut shaped) neighborhood defined by an inner and outer radius.</bullet_item><para/>
        ///     <bullet_item>Circle—A circular neighborhood with the given radius. This is default where the radius is the shortest of the width or height of the extent of the input point features, in the output spatial reference, divided by 30.</bullet_item><para/>
        ///     <bullet_item>Rectangle—A rectangular neighborhood with the given height and width.</bullet_item><para/>
        ///     <bullet_item>Wedge—A wedge-shaped neighborhood. A wedge is specified by a start angle, an end angle and a radius. The wedge extends counterclockwise from the starting angle to the ending angle. Angles are specified in arithmetic degrees (counterclockwise from the positive x-axis). Negative angles may be used.</bullet_item><para/>
        ///     <bullet_item>Cell | Map—Defines the units of the selected neighborhood measurements in either cells or map units (based on the linear unit of the projection of the output spatial reference).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于计算密度值的每个像元周围区域的形状。</para>
        ///   <bulletList>
        ///     <bullet_item>环 - 由内半径和外半径定义的环面（甜甜圈形）邻域。</bullet_item><para/>
        ///     <bullet_item>圆 - 具有给定半径的圆形邻域。这是默认值，其中半径为输出空间参考中输入点要素范围的宽度或高度的最短除以 30。</bullet_item><para/>
        ///     <bullet_item>矩形 - 具有给定高度和宽度的矩形邻域。</bullet_item><para/>
        ///     <bullet_item>楔形 - 楔形邻域。楔块由起始角、端角和半径指定。楔块从起始角逆时针延伸到结束角。角度以算术度数指定（从正 x 轴逆时针方向）。可以使用负角。</bullet_item><para/>
        ///     <bullet_item>电池片 |地图 - 以像元或地图单位（基于输出空间参考投影的线性单位）定义所选邻域测量的单位。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Neighborhood")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _neighborhood { get; set; } = null;


        /// <summary>
        /// <para>Area units</para>
        /// <para><xdoc>
        ///   <para>The area units of the output density values.</para>
        ///   <para>A default unit is selected based on the linear unit of the output spatial reference. You can change this to the appropriate unit if you want to convert the density output. Values for line density convert the units of both length and area.</para>
        ///   <para>If no output spatial reference is specified, the output spatial reference will be the same as the input feature class. The default output density units are determined by the linear units of the output spatial reference as follows. If the output linear units are meters, the output area density units will be set to Square kilometers, outputting square kilometers for point features or kilometers per square kilometers for polyline features. If the output linear units are feet, the output area density units will be set to Square miles.</para>
        ///   <para>If the output units is anything other than feet or meters, the output area density units will be set to Square map units. That is, the output density units will be the square of the linear units of the output spatial reference. For example, if the output linear units are centimeters, the output area density units will be Square map units, which will result in square centimeters. If the output linear units are kilometers, the output area density units will be Square map units, which will result in square kilometers.</para>
        ///   <para>The available options and their corresponding output density units are the following:</para>
        ///   <bulletList>
        ///     <bullet_item>Square map units—For the square of the linear units of the output spatial reference.</bullet_item><para/>
        ///     <bullet_item>Square miles—For miles (U.S.).</bullet_item><para/>
        ///     <bullet_item>Square kilometers—For kilometers.</bullet_item><para/>
        ///     <bullet_item>Acres—For acres (U.S.).</bullet_item><para/>
        ///     <bullet_item>Hectares—For hectares.</bullet_item><para/>
        ///     <bullet_item>Square yards—For yards (U.S.).</bullet_item><para/>
        ///     <bullet_item>Square feet—For feet (U.S.).</bullet_item><para/>
        ///     <bullet_item>Square inches—For inches (U.S.).</bullet_item><para/>
        ///     <bullet_item>Square meters—For meters.</bullet_item><para/>
        ///     <bullet_item>Square centimeters—For centimeters.</bullet_item><para/>
        ///     <bullet_item>Square millimeters—For millimeters.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出密度值的面积单位。</para>
        ///   <para>根据输出空间参考的线性单位选择默认单位。如果要转换密度输出，可以将其更改为适当的单位。线密度值可转换长度和面积的单位。</para>
        ///   <para>如果未指定输出空间参考，则输出空间参考将与输入要素类相同。默认输出密度单位由输出空间参考的线性单位确定，如下所示。如果输出线性单位为米，则输出区域密度单位将设置为平方公里，对于点要素输出平方公里，对于折线要素输出千米/平方公里。如果输出线性单位为英尺，则输出区域密度单位将设置为平方英里。</para>
        ///   <para>如果输出单位不是英尺或米，则输出区域密度单位将设置为方形地图单位。也就是说，输出密度单位将是输出空间参考的线性单位的平方。例如，如果输出线性单位为厘米，则输出区域密度单位将为正方形地图单位，这将产生平方厘米。如果输出线性单位为千米，则输出区域密度单位将为平方地图单位，这将导致平方千米。</para>
        ///   <para>可用选项及其相应的输出密度单位如下：</para>
        ///   <bulletList>
        ///     <bullet_item>方形地图单位 - 用于输出空间参考的线性单位的平方。</bullet_item><para/>
        ///     <bullet_item>平方英里 - 以英里（美国）为单位。</bullet_item><para/>
        ///     <bullet_item>平方公里 - 以公里为单位。</bullet_item><para/>
        ///     <bullet_item>英亩 - 表示英亩（美国）。</bullet_item><para/>
        ///     <bullet_item>公顷 - 用于公顷。</bullet_item><para/>
        ///     <bullet_item>平方码 - 用于码（美国）。</bullet_item><para/>
        ///     <bullet_item>平方英尺 - 英尺（美国）。</bullet_item><para/>
        ///     <bullet_item>Square 英寸 - 英寸（美国）。</bullet_item><para/>
        ///     <bullet_item>平方米 - 用于米。</bullet_item><para/>
        ///     <bullet_item>平方厘米 - 用于厘米。</bullet_item><para/>
        ///     <bullet_item>平方毫米 - 以毫米为单位。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Area units")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _area_unit_scale_factor_value _area_unit_scale_factor { get; set; } = _area_unit_scale_factor_value._SQUARE_MAP_UNITS;

        public enum _area_unit_scale_factor_value
        {
            /// <summary>
            /// <para>Square map units</para>
            /// <para>Square map units—For the square of the linear units of the output spatial reference.</para>
            /// <para>方形地图单位 - 用于输出空间参考的线性单位的平方。</para>
            /// </summary>
            [Description("Square map units")]
            [GPEnumValue("SQUARE_MAP_UNITS")]
            _SQUARE_MAP_UNITS,

            /// <summary>
            /// <para>Square miles</para>
            /// <para>Square miles—For miles (U.S.).</para>
            /// <para>平方英里 - 以英里（美国）为单位。</para>
            /// </summary>
            [Description("Square miles")]
            [GPEnumValue("SQUARE_MILES")]
            _SQUARE_MILES,

            /// <summary>
            /// <para>Square kilometers</para>
            /// <para>Square kilometers—For kilometers.</para>
            /// <para>平方公里 - 以公里为单位。</para>
            /// </summary>
            [Description("Square kilometers")]
            [GPEnumValue("SQUARE_KILOMETERS")]
            _SQUARE_KILOMETERS,

            /// <summary>
            /// <para>Acres</para>
            /// <para>Acres—For acres (U.S.).</para>
            /// <para>英亩 - 表示英亩（美国）。</para>
            /// </summary>
            [Description("Acres")]
            [GPEnumValue("ACRES")]
            _ACRES,

            /// <summary>
            /// <para>Hectares</para>
            /// <para>Hectares—For hectares.</para>
            /// <para>公顷 - 用于公顷。</para>
            /// </summary>
            [Description("Hectares")]
            [GPEnumValue("HECTARES")]
            _HECTARES,

            /// <summary>
            /// <para>Square yards</para>
            /// <para>Square yards—For yards (U.S.).</para>
            /// <para>平方码 - 用于码（美国）。</para>
            /// </summary>
            [Description("Square yards")]
            [GPEnumValue("SQUARE_YARDS")]
            _SQUARE_YARDS,

            /// <summary>
            /// <para>Square feet</para>
            /// <para>Square feet—For feet (U.S.).</para>
            /// <para>平方英尺 - 英尺（美国）。</para>
            /// </summary>
            [Description("Square feet")]
            [GPEnumValue("SQUARE_FEET")]
            _SQUARE_FEET,

            /// <summary>
            /// <para>Square inches</para>
            /// <para>Square inches—For inches (U.S.).</para>
            /// <para>Square 英寸 - 英寸（美国）。</para>
            /// </summary>
            [Description("Square inches")]
            [GPEnumValue("SQUARE_INCHES")]
            _SQUARE_INCHES,

            /// <summary>
            /// <para>Square meters</para>
            /// <para>Square meters—For meters.</para>
            /// <para>平方米 - 用于米。</para>
            /// </summary>
            [Description("Square meters")]
            [GPEnumValue("SQUARE_METERS")]
            _SQUARE_METERS,

            /// <summary>
            /// <para>Square centimeters</para>
            /// <para>Square centimeters—For centimeters.</para>
            /// <para>平方厘米 - 用于厘米。</para>
            /// </summary>
            [Description("Square centimeters")]
            [GPEnumValue("SQUARE_CENTIMETERS")]
            _SQUARE_CENTIMETERS,

            /// <summary>
            /// <para>Square millimeters</para>
            /// <para>Square millimeters—For millimeters.</para>
            /// <para>平方毫米 - 以毫米为单位。</para>
            /// </summary>
            [Description("Square millimeters")]
            [GPEnumValue("SQUARE_MILLIMETERS")]
            _SQUARE_MILLIMETERS,

        }

        public PointDensity SetEnv(int? autoCommit = null, object cellSize = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}